package com.qiaofang.mapper;

import com.qiaofang.common.model.PageDTO;
import com.qiaofang.dto.PartnerPremisesDTO;
import com.qiaofang.dto.SearchWxMsgFailureDTO;
import com.qiaofang.entity.Premises;
import com.qiaofang.entity.WxMsgFailure;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;
import tk.mybatis.mapper.common.ExampleMapper;

import java.util.List;

/**
 * @author qi.liu
 * @date: 2021/1/12 15:10
 */
@Mapper
public interface WxMsgFailureMapper extends BaseMapper<Premises>, ExampleMapper<Premises> {

    /**
     * 查询微信推送失败消息的总数
     * @param wxMsgFailureDTO
     * @return
     */
    Long listWxMsgFailureCount(@Param("wxMsgFailureDTO") SearchWxMsgFailureDTO wxMsgFailureDTO);

    /**
     * 查询微信推送失败的消息
     * @param wxMsgFailureDTO
     * @param page
     * @return
     */
    List<WxMsgFailure> listWxMsgFailure(@Param("wxMsgFailureDTO") SearchWxMsgFailureDTO wxMsgFailureDTO, @Param("page") PageDTO page);

    /**
     * 通过驻场人员id与楼盘id查询微信消息推送权限
     * @param partnerPremisesDTO
     * @return
     */
    String findWxMsgStatus(@Param("partnerPremisesDTO") PartnerPremisesDTO partnerPremisesDTO);

    /**
     * 通过楼盘id查询该楼盘的驻场人员id
     * @param premisesId
     * @return
     */
    List<Integer> findPartnerId(@Param("premisesId") Long premisesId);
}
